<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <form action="###">
      用户名:<input type="text" name="username" v-model.trim="person.username">
      密码:<input type="text" name="password" v-model.lazy="person.password">
      年龄:<input type="text" name="age" v-model.number="person.age">

      请选择你喜欢的城市
      <input type="checkbox" name="city" v-model="person.city" value="北京">北京
      <input type="checkbox" name="city" v-model="person.city" value="上海">上海
      <input type="checkbox" name="city" v-model="person.city" value="武汉">武汉
    </form>
  </div>
  <script>
    Vue.config.productionTip = false;

    const vm = new Vue({
      el: "#app",
      data() {
        return {
          person: {
            username: "",
            password: null,
            age : "",
            city :[]
          }
        }
      }
    })
  </script>
</body>

</html>